See http://terpconnect.umd.edu/~toh/spectrum/TFit.html for details.

tfit.m (Matlab/Octave)
The tfit.m function is a self-contained command-line Matlab/Octave function that demonstrates a computational method for quantitative analysis by multiwavelength absorption spectroscopy which uses convolution and iterative curve fitting to correct for spectroscopic non-linearity. The syntax is tfit(TrueAbsorbance).

TFit3.m (Matlab/Octave)
TFit3.m is a self-contained command-line Matlab/Octave function for a mixture of 3 absorbing components; the syntax is  TFit3(TrueAbsorbanceVector, e.g. TFit3([3 .2 5]).

TFitDemo.m  (Matlab only)
Interactive demonstration of the Tfit method for a single absorbing peak, with keystroke controls for adjusting the true absorbance (Peak A), peak shape, spectral width of the absorption peak (AbsWidth), width of the instrument function (SlitWidth), stray light and the noise level (Noise) continuously while observing the effect dynamically. Simulates the effect of photon noise, stray light and random background intensity shifts. Compares observed absorbances computed by the single-wavelength, weighted multilinear regression (sometimes called Classical Least Squares in the chemometrics literature), and TFit methods. The latest version (September, 2011) includes keys that compute the statistics (Tab key) and analytical calibration curve (M key). Press K to see all the key controls.

TFitStats.m (Matlab/Octave)
Statistics of the TFit method compared to single-wavelength (SingleW), simple regression (SimpleR), and weighted regression (WeightR) methods. Simulates photon noise, stray light and random background intensity shifts. Estimates the precision and accuracy of the four methods by repeating the calculations 50 times with different random noise samples. Computes the mean, relative percent standard deviation, and relative percent deviation from true absorbance. Parameters are easily changed in lines 19 - 26. Results displayed in the MATLAB command window.

TFitCalCurve.m (Matlab/Octave)
Comparison of analytical curves for single-wavelength, simple regression, weighted regression, and TFit methods over any specified absorbance range (specified by the vector absorbancelist in line 20). Simulates photon noise, stray light and random background intensity shifts. Plots a log-log scatter plot with each repeat measurement plotted as a separate point. The parameters can be changed in lines 20 - 27.

TFit3Demo.m (Matlab only)
Interactive demonstration of multi-wavelength absorption spectroscopy of a mixture of three absorbers, with controls that allow you to adjust the parameters continuously while observing the effect dynamically. The adjustable parameters are: the absorbances of the three components (A1, A2, and A3), spectral overlap between the component spectra (Sepn), width of the instrument function (SlitWidth), and the noise level (Noise). Compares quantitative measurement by weighted regression and TFit methods. Simulates photon noise, stray light and random background intensity shifts. Note: After executing this m-file, slide the Figure No. 1 and Figure No.2 windows side-by-side so that they don't overlap. Figure 1 shows a log-log scatter plot of the true vs. measured absorbances, with the three absorbers plotted in different colors and symbols. Figure 2 shows the transmission spectra of the three absorbers plotted in the corresponding colors. As you adjust the sliders in Figure No. 1, both graphs change accordingly.

The folder "old TFit for Matlab 6.5" contains the older 2006 versions using sliders that run in Matlab 6.5

Note: In the most common type of absorption spectrometer, the instrument width (SlitWidth) is changed by changing the slit width, which also effects the light intensity and the signal-to-noise ratio.  Therefore, all these programs, when you change SlitWidth, the photon noise is automatically changed accordingly. 
